
package metier;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class EmpruntArchive {

	private Calendar dateRestitutionEff  ;
	private Calendar dateEmprunt;
	private String isbn;
	ArrayList<EmpruntArchive> Archlist = new ArrayList<EmpruntArchive>();
	public static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
	public EmpruntArchive(Calendar dateRestitutionEff, Calendar dateEmprunt) {
		super();
		this.dateRestitutionEff = dateRestitutionEff;
		this.dateEmprunt = dateEmprunt;
	}	

	public EmpruntArchive(Calendar dateEmprunt, Calendar dateRetour, String isbn ) {
		this.dateEmprunt = dateEmprunt;
		this.dateRestitutionEff = dateRetour;
		this.isbn = isbn;
	}
	

	public EmpruntArchive(Date date, Calendar dateEmprunt2, Exemplaire exemplaire) {
		
	}

	public EmpruntArchive(Date date, Calendar dateEmprunt2, Utilisateur emprunteur, Exemplaire exemplaire) {
		
	}
	public ArrayList<EmpruntArchive>  createArchive(EmpruntEnCours ep) {
		 EmpruntArchive emp = new EmpruntArchive(new Date(), ep.getDateEmprunt(), ep.getExemplaire());
		 Archlist.add(emp);
		 return Archlist;
	}
	public ArrayList <EmpruntArchive> listArchive() {
		return Archlist;
	}
	@Override
	public String toString() {
		return "Date de Restitution Eff = " + sdf.format(dateRestitutionEff.getTime())
				+ "\nDate Emprunt = " + sdf.format(dateEmprunt.getTime()) +
				"\nISBN = " + isbn ;
	}
	
	

}
